Row

S&P 500

Row

Price to Earnings Ratio - S&P 500

Price to Sales Ratio - S&P 500

Dividend Yield - S&P 500

Market Cap to GDP - US

Volatility Index (VIX)

---
title: "Market Indicators"
author: "Charlotte McClintock"
output: 
  flexdashboard::flex_dashboard:
    orientation: rows
    social: menu
    source_code: embed
---

```{r setup, include=FALSE}

library(knitr)
library(tidyverse)
library(shiny)
library(plotly)
library(DT)
library(shinythemes)
library(markdown)
library(rsconnect)
library(ggplot2)

load("stockmkt.Rdata")
```

```{r, eval=FALSE, echo=FALSE}
About {.sidebar}
-----------------------------------------------------------------------
This project explores indicators of the financial health and stability of the stock market including price to earnings ratio, price to sales ratio, US market capitalization to GDP, and volatility index. 
```

Row
-----------------------------------------------------------------------

### S&P 500

```{r}
p <- ggplot(SP, aes(x=date, y=sp500)) +
            geom_point(size = 1, color='darkblue') + geom_line(color='darkblue') 
ggplotly(p)
```



Row {.tabset}
-----------------------------------------------------------------------

### Price to Earnings Ratio - S&P 500

```{r}
p <- ggplot(PER, aes(x=date, y=price2earnings)) +
            geom_point(size = 1, color='darkred') + geom_line(color='darkred') 
ggplotly(p)
```

### Price to Sales Ratio - S&P 500

```{r}
p <- ggplot(PSR, aes(x=date, y=price2sales)) +
            geom_point(size = 1, color='green') + geom_line(color='green')
ggplotly(p)
```

### Dividend Yield - S&P 500

```{r}
p <- ggplot(DY, aes(x=date, y=dividendyield)) +
            geom_point(size = 1, color='blue') + geom_line(color='blue')
ggplotly(p)
```

### Market Cap to GDP - US

```{r}
p <- ggplot(data = mktcap2gdp, aes(x = date, y = mktcap2gdp)) + 
        geom_point(size = 1, color='orange') + geom_line(color='orange')
ggplotly(p)
```

### Volatility Index (VIX)

```{r}
p <- ggplot(data = vix, aes(x = date, y = volatilityindex)) + 
        geom_point(size = 1, color='purple') + geom_line(color='purple')
ggplotly(p)
```